import { createSlice } from "@reduxjs/toolkit";
import { TabsState } from "../interface";

const tabsState: TabsState = {
	tabsList: [{ label: "首页", key: "/home/index", closable: false }]
};

const tabsSlice = createSlice({
	name: "tabs",
	initialState: tabsState,
	reducers: {
		setTabsList(state, { payload }) {
			state.tabsList = payload;
		}
	}
});

export const { setTabsList } = tabsSlice.actions;
export default tabsSlice.reducer;
